package com.resign.carl.command.example2.api.impl;

import com.resign.carl.command.example1.api.Command;
import com.resign.carl.command.example2.api.Stereo;

/**
 * Created by carl.zhao on 2016/6/15.
 */
public class StereoOffCommand implements Command {

    private Stereo stereo;

    public StereoOffCommand(Stereo stereo){
        this.stereo = stereo;
    }

    @Override
    public void execute() {
        stereo.setVolume(0);
    }

    @Override
    public void undo() {
        stereo.setVolume(15);
    }
}
